^
   HOME

TheInfoList



OR:

Caret is the name used familiarly for the character , provided on most QWERTY keyboards by typing . The symbol has a variety of uses in programming and mathematics. The name "caret" arose from its visual similarity to the original proofreader's caret, a mark used in
proofreading Proofreading is the reading of a galley proof or an electronic copy of a publication to find and correct reproduction errors of text or art. Proofreading is the final step in the editorial cycle before publication. Professional Traditional ...
to indicate where a punctuation mark, word, or phrase should be inserted into a document. The formal ASCII standard (X3.64.1977) calls it a "
circumflex The circumflex () is a diacritic in the Latin and Greek scripts that is also used in the written forms of many languages and in various romanization and transcription schemes. It received its English name from la, circumflexus "bent around"a ...
".


History


Typewriters

On typewriters designed for languages that routinely use
diacritic A diacritic (also diacritical mark, diacritical point, diacritical sign, or accent) is a glyph added to a letter or to a basic glyph. The term derives from the Ancient Greek (, "distinguishing"), from (, "to distinguish"). The word ''diacriti ...
s (accent marks), there are two possible ways to type these. Keys can be dedicated to precomposed characters (with the diacritic included) or alternatively a dead key mechanism can be provided. With the latter, a mark is made when a dead key is typed but, unlike normal keys, the paper carriage does not move on and thus the next letter to be typed is printed under the accent. The symbol was originally provided in typewriters and computer printers so that circumflex accents could be overprinted on letters (as in or ).


Transposition into ISO/IEC 646 and ASCII

The incorporation of the circumflex symbol into ASCII is a consequence of this prior existence on typewriters. This symbol did not exist independently as a
type Type may refer to: Science and technology Computing * Typing, producing text via a keyboard, typewriter, etc. * Data type, collection of values used for computations. * File type * TYPE (DOS command), a command to display contents of a file. * Ty ...
or hot-lead printing character. The original 1963 version of the ASCII standard used the code point x5E for an . However, the 1965 ISO/IEC646 standard defined code-point x5E as one of five available for national variation, with the circumflex diacritic as the default and the up-arrow as one of the alternative uses. In 1967, the second revision of ASCII followed suit. Overprinting to add an accent mark was not always supported well by printers, and was almost never possible on video terminals. Instead precomposed characters were eventually created to show the accented letters. The freestanding circumflex (which had become to be called a caret) quickly became reused for many other purposes, such as in computer languages and mathematical notation. As the mark did not need to fit above a letter anymore, it became larger in appearance such that it can no longer be used to overprint an accent. In Unicode it is encoded as and in HTML may be inserted with . This caret is not to be confused with other chevron-shaped characters, such as the turned v or the logical AND, which may occasionally be called carets.


Uses


Programming languages

The symbol has many uses in programming languages, where it is typically called a caret. It can signify exponentiation, the bitwise
XOR Exclusive or or exclusive disjunction is a logical operation that is true if and only if its arguments differ (one is true, the other is false). It is symbolized by the prefix operator J and by the infix operators XOR ( or ), EOR, EXOR, , ...
operator, string concatenation, and control characters in caret notation, among other uses. In regular expressions, the caret is used to match the beginning of a string or line; if it begins a character class, then the inverse of the class is to be matched. ANSI C can transcribe the caret in the form of the trigraph , as the character was originally not available in all character sets and keyboards. C++ additionally supports tokens like (for ) and (for ) to avoid the character altogether. recommends that the character be transcribed as digraph when required.
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, Fren ...
uses the caret for declaring and dereferencing pointers. In
Smalltalk Smalltalk is an object-oriented, dynamically typed reflective programming language. It was designed and created in part for educational use, specifically for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Ka ...
, the caret is the method return statement. In C++/CLI, .NET reference types are accessed through a handle using the syntax. In Apple's C extensions for Mac OS X and iOS, carets are used to create blocks and to denote block types. Go uses it as a bitwise NOT operator. Node.js uses the caret in package.json files to signify dependency resolution behavior being used for each particular dependency. In the case of Node.js, a caret allows any kind of update, unless it is seen as a "major" update as defined by
semver Software versioning is the process of assigning either unique ''version names'' or unique ''version numbers'' to unique states of computer software. Within a given version number category (e.g., major or minor), these numbers are generally assig ...
.


Surrogate symbol for superscript and exponentiation

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, the caret can signify exponentiation (3^5 for ), where the usual
superscript A subscript or superscript is a character (such as a number or letter) that is set slightly below or above the normal line of type, respectively. It is usually smaller than the rest of the text. Subscripts appear at or below the baseline, whil ...
is not readily usable (as on some graphing calculators). It is also used to indicate a superscript in TeX typesetting. As
Isaac Asimov yi, יצחק אזימאװ , birth_date = , birth_place = Petrovichi, Russian SFSR , spouse = , relatives = , children = 2 , death_date = , death_place = Manhattan, New York City, U.S. , nationality = Russian (1920–1922)Soviet (192 ...
described it in his 1974 "''Skewered!''" essay (on Skewes' number), "I make the exponent a figure of normal size and it is as though it is being held up by a lever, and its added weight when its size grows bends the lever down." The use of the caret for exponentiation can be traced back to
ALGOL 60 ALGOL 60 (short for ''Algorithmic Language 1960'') is a member of the ALGOL family of computer programming languages. It followed on from ALGOL 58 which had introduced code blocks and the begin and end pairs for delimiting them, representing a k ...
, which expressed the exponentiation operator as an upward-pointing arrow, intended to evoke the superscript notation common in mathematics. The upward-pointing arrow is now used to signify
hyperoperations In mathematics, the hyperoperation sequence is an infinite sequence of arithmetic operations (called ''hyperoperations'' in this context) that starts with a unary operation (the successor function with ''n'' = 0). The sequence continues with the ...
in Knuth's up-arrow notation.


Escape character

Often seen as caret notation to show control characters, for instance means the control character with value 1. The command-line interpreter, cmd.exe, of Windows uses the caret to
escape Escape or Escaping may refer to: Computing * Escape character, in computing and telecommunication, a character which signifies that what follows takes an alternative interpretation ** Escape sequence, a series of characters used to trigger some so ...
reserved characters (most other shells use the backslash). For instance to pass a less-than sign as an argument to a program you type .


Upwards-pointing arrow

In internet forums, social networking sites such as Facebook, or in online chats, one or more carets may be used beneath the text of another post, representing an upwards-pointing arrow to that post. In addition to the arrow usage, it can also mean that the user who posted the ^ agrees with the above post. Multiple carets may indicate the comment is replying to or relating to the post above that correlates with the number of carets used, or to "underscore" the correct portion of the previous post, or may simply be used for emphasis. A similar use has been adopted by programming language compilers such as Java compiler to point out where a compilation error has occurred. The compiler prints out the faulty line of code and uses a single caret on the next line, padded by spaces, to give a visual indication of the error location.


See also

* Caret as used in
proofreading Proofreading is the reading of a galley proof or an electronic copy of a publication to find and correct reproduction errors of text or art. Proofreading is the final step in the editorial cycle before publication. Professional Traditional ...
and typography * Hat operator, a notation used in mathematics and statistics, is sometimes called a caret


Notes


References

{{Reflist, refs=
Isaac Asimov yi, יצחק אזימאװ , birth_date = , birth_place = Petrovichi, Russian SFSR , spouse = , relatives = , children = 2 , death_date = , death_place = Manhattan, New York City, U.S. , nationality = Russian (1920–1922)Soviet (192 ...
(1974), "Skewered", ''Of Matters Great and Small'', Doubleday, {{ISBN, 978-0385022255
{{cite web , title = What is Caret? , url = http://www.computerhope.com/jargon/c/caret.htm , publisher = Computer Hope, access-date = 14 August 2012 {{cite web , url = http://www.worldpowersystems.com/projects/codes/index.html#UP , title = ASCII: American Standard Code for Information Infiltration , author = Tom Jennings , access-date = 14 September 2010 , archive-url = https://web.archive.org/web/20140821121342/http://www.worldpowersystems.com/projects/codes/index.html#UP , archive-date = 21 August 2014 , url-status = dead {{cite web, url = https://jkorpela.fi/kirjaimet/tarinoita.pdf , title = Kirjainten tarinoita , author = Jukka K. Korpela , pages = 132–133 , date = 18 January 2010 , access-date = 14 September 2010 , language = fi {{cite web , url = http://unicode.org/charts/PDF/U0250.pdf , title = IPA Extensions , author = Unicode , date = 1991–2012 , access-date = 20 August 2012 {{cite web , url = http://mathworld.wolfram.com/Caret.html , title = Caret , author = Eric W. Weisstein , work = MathWorld , publisher = Wolfram , access-date = 20 August 2012 Typographical symbols